package 代码记录.指定公司代码练习记录.华为_2024.分值100;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author zx
 * @create 2024-01-31 12:13
 * 自己做出来了
 */
public class 寿司转盘_10 {
    /**
     * 暴力解法
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] strs = str.split(" ");
        int[] prices = new int[strs.length];
        for(int i = 0;i < strs.length;i++){
            prices[i] = Integer.parseInt(strs[i]);
        }
        int[] res = new int[prices.length];
        int len = prices.length;
        for(int i = 0;i < prices.length;i++){
            boolean flag = true;
            for(int j = len, k = i + 1;j > 0;j--, k++){
                if(prices[k % len] < prices[i]){
                    res[i] = prices[k % len] + prices[i];
                    flag = false;
                    break;
                }
            }
            if(flag){
                res[i] = prices[i];
            }
        }
        System.out.println(Arrays.toString(res));
    }
}
